package com.sinai.mshab.data;

/**
 * The generic interface to be used for data management of UI elements in a GWT
 * application.
 * 
 * @author Arthur Kalmenson
 * 
 * @param <T>
 *            the type of widget being managed.
 * @param <S>
 *            the type of data the widget uses.
 */
public interface DataManager<T, S> {

	/**
	 * Returns the data in {@code widget}.
	 * 
	 * @param widget
	 *            the GWT widget who's data we are getting.
	 * @return the data in {@code widget}.
	 */
	public S getData(T widget);

	/**
	 * Sets the data of {@code widget} to {@code data}.
	 * 
	 * @param widget
	 *            the GWT widget to set.
	 * @param data
	 *            the data for the widget.
	 */
	public void setData(T widget, S data);
}
